from django.conf.urls import patterns, include, url

#http://docs.djangoproject.com/en/1.3/howto/static-files/
from django.contrib.staticfiles.urls import staticfiles_urlpatterns

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:  
    # url(r'^mrEdu/', include('core.foo.urls')),
    # Uncomment the admin/doc line below to enable admin documentation:
    #url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    # Uncomment the next line to enable the admin:
    
    # i18n
    url(r'^i18n/',                                     include('django.conf.urls.i18n')),
    
    # admin
    url(r'^admin/',                                    include(admin.site.urls)),
    url(r'^accounts/login/$',                          "core.view_common.user_login"),
    
    # common
    url(r'^$',                                         "core.view_common.user_login"),
    url(r'^mrEdu/$',                                   "core.view_common.user_login"),
    url(r'^mrEdu/logout$',                             "core.view_common.user_logout"),
    
    # teacher
    url(r'^mrEdu/teacher$',                            "core.view_teacher.index"),
    url(r'^mrEdu/teacher/classes$',                    "core.view_teacher.courses"),
    url(r'^mrEdu/teacher/class/(\d+)/$',               "core.view_teacher.course"),
    url(r'^mrEdu/teacher/class/choose$',               "core.view_teacher.course_choose"),
    url(r'^mrEdu/teacher/class/(\d+)/collection/new$', "core.view_teacher.collection_new"),
    url(r'^mrEdu/teacher/collection/(\d+)/$',          "core.view_common.collection"),
    url(r'^mrEdu/teacher/collections$',                "core.view_common.collections"),
    url(r'^mrEdu/teacher/collections/$',               "core.view_common.collections"),
    url(r'^mrEdu/teacher/content/(\d+)/$',             "core.view_common.content"),
    url(r'^mrEdu/teacher/content/upload$',             "core.view_common.content_upload"),
    url(r'^mrEdu/teacher/content/upload/from/(\w+)/$', "core.view_common.content_upload_from"),
    url(r'^mrEdu/teacher/search$',                     "core.view_common.search"),
    url(r'^mrEdu/teacher/search/result$',              "core.view_common.search_result"),
    
    # student
    url(r'^mrEdu/student/$',                           "core.view_student.index"),
    url(r'^mrEdu/student/collection/(\d+)/$',          "core.view_common.collection"),
    url(r'^mrEdu/student/collections',                 "core.view_common.collections"),
    url(r'^mrEdu/student/content/(\d+)/$',             "core.view_common.content"),
    url(r'^mrEdu/student/content/upload$',             "core.view_common.content_upload"),
    url(r'^mrEdu/student/content/upload/from/(\w+)/$', "core.view_common.content_upload_from"),
    url(r'^mrEdu/student/search$',                     "core.view_common.search"),
    url(r'^mrEdu/student/search/result$',              "core.view_common.search_result"),
)

#http://docs.djangoproject.com/en/1.3/howto/static-files/
urlpatterns += staticfiles_urlpatterns()